<!--
 * @Author: your name
 * @Date: 2020-03-12 16:29:50
 * @LastEditTime: 2020-03-29 13:24:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \smart-community\src\views\integral\integralDeclareDetails.vue
 -->
<template>
  <div id="integralDeclare">
    <van-nav-bar title="申报详情" left-arrow fixed @click-left="$router.go(-1)" />
    <div class="integralDeclare-body">
      <van-cell title="申报时间" :value="detail.creationDate" />
      <van-cell title="楼号" :value="detail.buildingCode" />
      <van-cell title="当事人姓名" :value="detail.applyName" />
      <van-cell title="当事人身份" :value="detail.applyIdentityName" />
      <van-cell title="类型" :value="detail.applyTypeName" />
      <van-cell title="内容描述:" :label="detail.content" />
      <van-cell title="驳回原因:" :label="detail.auditCause" v-if="detail.status == 5" />
      <div class="integralDeclare-img">
        <van-image width="100" height="100" :src="detail.image" @click="seeImg" />
      </div>
    </div>
  </div>
</template>

<script>
import integral from "../../controller/integral";
import { ImagePreview } from "vant";
export default {
  data() {
    return {
      detail: {}
    };
  },
  mounted() {
    this.getDetails();
  },
  methods: {
    seeImg() {
      ImagePreview({
        images: [this.detail.image]
      });
    },
    getDetails() {
      let id = this.$route.params.id;
      this.$toast.loading({
        message: "加载中...",
        forbidClick: true,
        loadingType: "spinner"
      });
      integral.integral_public_list_detatil(id).then(res => {
        if (res.code === "0") {
          if (res.datas) {
            this.detail = res.datas;
            this.$toast.clear();
          }
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
#integralDeclare {
  .van-cell__label {
    word-break: break-word;
  }
  .integralDeclare-img {
    padding: 20px;
    background: #fff;
  }
}
</style>
